<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>lesson 21</title>
  <script src="https://unpkg.com/vue@next"></script>
</head>
<body>
  <div id="root"></div>
</body>
<script>
  // 多级传递属性参数使用  provide 传值，inject接收值
  const app = Vue.createApp({

    data(){
      return {
        isShow: 'input-item',
        count: 888,
      }
    },
   /* provide: {
      count: 666,
    },*/
    provide(){
      return {
        count: this.count,
      }
    },
    methods: {
      handClick(){
      },
    },
    template: `
      <div>
        <child/>
      </div>
    `
  });
  app.component('child', {
    template: `
      <child-child/>
      `
  })
  app.component('child-child', {
    inject: ['count'],
    template: `
      <div>{{count}}</div>
      `
  })
  const vm = app.mount('#root');
</script>
</html>